﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第三十八题
//BC40 竞选社长
//https://www.nowcoder.com/practice/45a30e3ef51040ed8a7674984d6d1553?tpId=107&tqId=33321&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>

int main() {
    char ch;
    char ch1 = 'A';
    char ch2 = 'A';

    while ((ch = getchar()) != '0') {
        if (ch == 'A') {
            ch1++;
        }
        else {
            ch2++;
        }
    }
    if (ch1 > ch2)
        printf("A");
    else if (ch1 < ch2)
        printf("B");
    else
        printf("E");

    return 0;
}